#include "bits/stdc++.h"
using namespace std;
#define N 5
#define R 3
int result[R] = {0};
int number[N] = {1, 2, 3, 4, 5};
int num = 0;
void output()
{
    int i;
    for (i = 0; i < R; i++)
    {
        cout << number[result[i]];
        cout << " ";
    }
    cout << "\n";
}
void f1(int postion, int start)
{
    if (postion >= R)
    {
        num++;
        output();
        return;
    }
    if (start >= N)
    {
        return;
    }
    result[postion] = start;
    f1(postion + 1, start);
    // 不选当前的话
    f1(postion, start + 1);
}

int main()
{
    f1(0, 0);
}